package com.hsurosy.infrastructure.persistent.dao;

import com.hsurosy.infrastructure.persistent.po.Award;
import com.hsurosy.infrastructure.persistent.po.StrategyAward;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * @Author Hsu琛君珩
 * @Date 2024-10-14 18:58
 * @Description 抽奖策略奖品 DAO
 * @Version: v1.0.0
 */
@Mapper
public interface IStrategyAwardDao {

    /**
     * 获取所有抽奖策略奖品列表
     *
     * @return
     * [
     *     StrategyAward(1, 100001L, 101, "随机积分", 80000, 80000, new BigDecimal("0.3000"), "tree_luck_award", 1),
     *     StrategyAward(2, 100001L, 102, "5次使用", 10000, 10000, new BigDecimal("0.2000"), "tree_luck_award", 2)
     * ]
     */
    List<StrategyAward> queryStrategyAwardList();

    /**
     * 根据策略 ID 获取该策略下的奖品列表
     *
     * @param strategyId 100001
     * @return
     * [
     *     StrategyAward(1, 100001L, 101, "随机积分", 80000, 80000, new BigDecimal("0.3000"), "tree_luck_award", 1),
     *     StrategyAward(2, 100001L, 102, "5次使用", 10000, 10000, new BigDecimal("0.2000"), "tree_luck_award", 2)
     * ]
     */
    List<StrategyAward> queryStrategyAwardListByStrategyId(Long strategyId);

    /**
     * 查询某个奖品的规则模型
     *
     * @param strategyAward StrategyAward 对象
     * @return "tree_luck_award"
     */
    String queryStrategyAwardRuleModels(StrategyAward strategyAward);

    /**
     * 更新奖品的库存
     *
     * @param strategyAward StrategyAward 对象
     */
    void updateStrategyAwardStock(StrategyAward strategyAward);

    /**
     * 查询特定奖品的信息
     *
     * @param strategyAwardReq StrategyAward 对象
     * @return StrategyAward(1, 100001L, 101, "随机积分", 80000, 80000, new BigDecimal("0.3000"), "tree_luck_award", 1)
     */
    StrategyAward queryStrategyAward(StrategyAward strategyAwardReq);

}
